<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Kinetis Bootloader: Application CRC Check</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Kinetis Bootloader
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
   <div id="projectbrief">Common bootloader for Kinetis devices</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Introduction</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__app__crc__check.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#enum-members">Enumerations</a>  </div>
  <div class="headertitle">
<div class="title">Application CRC Check<div class="ingroups"><a class="el" href="group__bootloader.html">Bootloader</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Application CRC check API.  
<a href="#details">More...</a></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Collaboration diagram for Application CRC Check:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<center><table><tr><td><div class="center"><iframe scrolling="no" frameborder="0" src="group__app__crc__check.svg" width="302" height="38"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</td></tr></table></center>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:structcrc__checksum__header__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__app__crc__check.html#structcrc__checksum__header__t">crc_checksum_header_t</a></td></tr>
<tr class="memdesc:structcrc__checksum__header__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">CRC Checksum Header.  <a href="group__app__crc__check.html#structcrc__checksum__header__t">More...</a><br /></td></tr>
<tr class="separator:structcrc__checksum__header__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gafde51133500eb811a5cad0f3d4f442fe"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__app__crc__check.html#gafde51133500eb811a5cad0f3d4f442fe">_crc_check_status</a> { <br />
&#160;&#160;<a class="el" href="group__app__crc__check.html#ggafde51133500eb811a5cad0f3d4f442fea641ef74391e865ae7e54bb12622303ac">kStatus_AppCrcCheckPassed</a> = MAKE_STATUS(kStatusGroup_AppCrcCheck, 0), 
<br />
&#160;&#160;<a class="el" href="group__app__crc__check.html#ggafde51133500eb811a5cad0f3d4f442feaff33003e21fd18ada03691ede1809292">kStatus_AppCrcCheckFailed</a> = MAKE_STATUS(kStatusGroup_AppCrcCheck, 1), 
<br />
&#160;&#160;<a class="el" href="group__app__crc__check.html#ggafde51133500eb811a5cad0f3d4f442fea7004441c55b51e5952c3858a85aa50c0">kStatus_AppCrcCheckInactive</a>, 
<br />
&#160;&#160;<a class="el" href="group__app__crc__check.html#ggafde51133500eb811a5cad0f3d4f442fea959904d37af81b22ba1322e18355166a">kStatus_AppCrcCheckInvalid</a>, 
<br />
&#160;&#160;<a class="el" href="group__app__crc__check.html#ggafde51133500eb811a5cad0f3d4f442feaacdc3c265ff339771981b271d9bd45b9">kStatus_AppCrcCheckOutOfRange</a>
<br />
 }<tr class="memdesc:gafde51133500eb811a5cad0f3d4f442fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Application crc check status codes.  <a href="group__app__crc__check.html#gafde51133500eb811a5cad0f3d4f442fe">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:gafde51133500eb811a5cad0f3d4f442fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
Crc check</h2></td></tr>
<tr class="memitem:ga9b257e13a9bee05b7070ab5b763b97dc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga9b257e13a9bee05b7070ab5b763b97dc"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__app__crc__check.html#ga9b257e13a9bee05b7070ab5b763b97dc">restore_crc_check_failure_pin</a> (void)</td></tr>
<tr class="memdesc:ga9b257e13a9bee05b7070ab5b763b97dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Restore crc check failure pin to default state. <br /></td></tr>
<tr class="separator:ga9b257e13a9bee05b7070ab5b763b97dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0da4da4f2021b61f916c5c3d4ae7ed97"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga0da4da4f2021b61f916c5c3d4ae7ed97"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__app__crc__check.html#ga0da4da4f2021b61f916c5c3d4ae7ed97">init_crc_check_status</a> (<a class="el" href="group__property.html#structproperty__store__t">property_store_t</a> *propertyStore)</td></tr>
<tr class="memdesc:ga0da4da4f2021b61f916c5c3d4ae7ed97"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize crc check status property based on BCA related fields. <br /></td></tr>
<tr class="separator:ga0da4da4f2021b61f916c5c3d4ae7ed97"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga19986303c69c35c18217959cf1b273c5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga19986303c69c35c18217959cf1b273c5"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__app__crc__check.html#ga19986303c69c35c18217959cf1b273c5">is_application_crc_check_pass</a> (void)</td></tr>
<tr class="memdesc:ga19986303c69c35c18217959cf1b273c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compare the CRC on a range of flash(specified in BCA) against a precomputed CRC value(stored in the BCA). <br /></td></tr>
<tr class="separator:ga19986303c69c35c18217959cf1b273c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0ea8d2ae21ac9331a7ec370ca6d39d1c"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__app__crc__check.html#ga0ea8d2ae21ac9331a7ec370ca6d39d1c">calculate_application_crc32</a> (<a class="el" href="group__app__crc__check.html#structcrc__checksum__header__t">crc_checksum_header_t</a> *header, uint32_t crcHeaderStart)</td></tr>
<tr class="memdesc:ga0ea8d2ae21ac9331a7ec370ca6d39d1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate CRC checksum according to specified checksum header.  <a href="#ga0ea8d2ae21ac9331a7ec370ca6d39d1c">More...</a><br /></td></tr>
<tr class="separator:ga0ea8d2ae21ac9331a7ec370ca6d39d1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Usage Information</h2>
<p>Application CRC check API. </p>
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="structcrc__checksum__header__t" id="structcrc__checksum__header__t"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct crc_checksum_header_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"><p>CRC Checksum Header. </p>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a66bae183afe72a2bfb4296479ae60b26"></a>uint32_t</td>
<td class="fieldname">
crcByteCount</td>
<td class="fielddoc">
[08:0b] </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="aefb1b6651d6f16f3d1c8a2ee4e7f2631"></a>uint32_t</td>
<td class="fieldname">
crcExpectedValue</td>
<td class="fielddoc">
[0c:0f] </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a670e6beffbf25764aae6da2e42152455"></a>uint32_t</td>
<td class="fieldname">
crcStartAddress</td>
<td class="fielddoc">
[04:07] </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a1c50fcd1195659821729f52af8f3bb7d"></a>uint32_t</td>
<td class="fieldname">
tag</td>
<td class="fielddoc">
[00:03] Tag value used to validate the bootloader configuration data. Must be set to 'kcfg'. </td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="gafde51133500eb811a5cad0f3d4f442fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__app__crc__check.html#gafde51133500eb811a5cad0f3d4f442fe">_crc_check_status</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Application crc check status codes. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="ggafde51133500eb811a5cad0f3d4f442fea641ef74391e865ae7e54bb12622303ac"></a>kStatus_AppCrcCheckPassed&#160;</td><td class="fielddoc">
<p>Crc check is valid and passed. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggafde51133500eb811a5cad0f3d4f442feaff33003e21fd18ada03691ede1809292"></a>kStatus_AppCrcCheckFailed&#160;</td><td class="fielddoc">
<p>Crc check is valid but failed. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggafde51133500eb811a5cad0f3d4f442fea7004441c55b51e5952c3858a85aa50c0"></a>kStatus_AppCrcCheckInactive&#160;</td><td class="fielddoc">
<p>Crc check is inactive, Needs to be verified. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggafde51133500eb811a5cad0f3d4f442fea959904d37af81b22ba1322e18355166a"></a>kStatus_AppCrcCheckInvalid&#160;</td><td class="fielddoc">
<p>Crc check is invalid, As the BCA is invalid or crc parameters are unset (all 0xff bytes). </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggafde51133500eb811a5cad0f3d4f442feaacdc3c265ff339771981b271d9bd45b9"></a>kStatus_AppCrcCheckOutOfRange&#160;</td><td class="fielddoc">
<p>Crc check is valid but addresses are out of range. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga0ea8d2ae21ac9331a7ec370ca6d39d1c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t calculate_application_crc32 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__app__crc__check.html#structcrc__checksum__header__t">crc_checksum_header_t</a> *&#160;</td>
          <td class="paramname"><em>header</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>crcHeaderStart</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculate CRC checksum according to specified checksum header. </p>
<p>Calculate CRC checksum according to specified checksum header. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Mar 7 2016 16:48:23 for Kinetis Bootloader by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
